package com.brightfuture.chrms.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.github.yulichang.annotation.EntityMapping;

import java.util.List;

/**
 * 人员;人员表
 *
 * @author Victor
 * @date 2024-02-03 17:00:42
 */
@Data
@TableName("person")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "人员")
public class PersonEntity extends Model<PersonEntity> {


    /**
     * 人员ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "人员ID")
    private Long perId;

    /**
     * 岗位ID
     */
    @Schema(description = "岗位ID")
    private Long positionId;

    /**
     * 姓名
     */
    @Schema(description = "姓名")
    private String name;

    /**
     * 证件类型
     */
    @Schema(description = "证件类型")
    private Integer idcardType;

    /**
     * 证件号码
     */
    @Schema(description = "证件号码")
    private String idCardNo;

    /**
     * 人员类别
     */
    @Schema(description = "人员类别")
    private String category;

    /**
     * 出生日期
     */
    @Schema(description = "出生日期")
    private LocalDateTime birth;

    /**
     * 性别
     */
    @Schema(description = "性别")
    private String gender;

    /**
     * 民族
     */
    @Schema(description = "民族")
    private String nation;

    /**
     * 户口所在地
     */
    @Schema(description = "户口所在地")
    private String regAddr;

    /**
     * 婚姻状况
     */
    @Schema(description = "婚姻状况")
    private String marital;

    /**
     * 健康状况
     */
    @Schema(description = "健康状况")
    private String health;

    /**
     * 政治面貌
     */
    @Schema(description = "政治面貌")
    private String parties;

    /**
     * 参加党派日期
     */
    @Schema(description = "参加党派日期")
    private LocalDateTime joinParties;

    /**
     * 首次参工日期
     */
    @Schema(description = "首次参工日期")
    private LocalDateTime firstWorkDate;

    /**
     * 个人身份
     */
    @Schema(description = "个人身份")
    private String identity;

    /**
     * 电话
     */
    @Schema(description = "电话")
    private String tel;

    /**
     * 传真
     */
    @Schema(description = "传真")
    private String fax;

    /**
     * 手机号码
     */
    @Schema(description = "手机号码")
    private String mobile;

    /**
     * 电子邮箱
     */
    @Schema(description = "电子邮箱")
    private String email;

    /**
     * 地址
     */
    @Schema(description = "地址")
    private String addr;

    /**
     * 其他信息
     */
    @Schema(description = "其他信息")
    private String other;

    /**
     * 人员状态
     */
    @Schema(description = "人员状态")
    private String state;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建人")
    private Long createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新人")
    private Long updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 删除标识
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "删除标识")
    private String delFlag;

    /**
     * 租户号
     */
    @Schema(description = "租户号")
    private Long tenantId;
    @ExcelIgnore
    @TableField(exist = false)
    @EntityMapping(thisField = "perId", joinField = "perId")
    private List<PersonPositionEntity> personPositionList;

    /*
     *  人员考勤信息
     */
    @ExcelIgnore
    @TableField(exist = false)
    @EntityMapping(thisField = "perId", joinField = "perId")
    private List<PersonAttendanceEntity> personAttendanceList;
}